"""
@Author：WangYuXiang
@E-mile：Hill@3io.cc
@CreateTime：2021/4/22 14:48
@DependencyLibrary：无
@MainFunction：无
@FileDoc： 
    models.py
    文件说明
@ChangeHistory:
    datetime action why
    example:
    2021/4/22 14:48 change 'Fix bug'
        
"""
from tortoise import Model
from tortoise.fields import BigIntField, DatetimeField, BooleanField
from common.utils.snowflake import snow_id


class BaseModel(Model):

    id = BigIntField(description='编号', pk=True, default=snow_id, generated=False)

    create_time = DatetimeField(auto_now_add=True, null=True, description='创建时间')
    update_time = DatetimeField(auto_now=True, null=True, description='跟新时间')

    is_delete = BooleanField(description='是否软删除', default=False)
    delete_time = DatetimeField(null=True, description='删除时间')

    class Meta:
        abstract = True
